package com.isoftstone.util;

import org.springframework.stereotype.Component;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;

import java.util.HashMap;
import java.util.Properties;

/**
 * 项目名称：
 *
 * @author: 修改日期：
 */

@Component
public class Const {
    /**
     * 中银快缴项目通知定义常量
     */
    public static final String n0001 = "0001";  //普通通知
    public static final String n0002 = "0002";  //签约通知
    public static final String n0003 = "0003";  //缴费通知


    public static final String readn = "0";  //未读
    public static final String ready = "1";  //已读
    public static final String send = "1";  //正常
    public static final String back = "0";  //撤回
    /**
     * 中银快缴项目定义常量
     */
    public static final String YQY = "YQY"; // 已签约
    public static final String DSH = "DSH"; // 待审核
    public static final String BPP = "BPP"; // 不匹配
    public static final String YSX = "YSX"; // 已失效
    public static final String BCZ = "BCZ"; // 不存在
    public static final String QRSQ = "QRSQ"; // 确认申请
    public static final String BNXY = "BNXY"; // 不能续约



    /**
     * 签约状态
     */
    public static final String SHIXOAO = "0"; // 失效
    public static final String SHENGXIAO = "1"; // 生效
    public static final String DAISHENHE = "2"; // 待审核


    /**
     * bind表状态
     */
    public static final String MBSHENGXIAO = "1"; // 生效中
    public static final String MBJIEYUE = "0"; // 解约


    /**
     * 为他人缴费
     */
    public static final String YHBCZ = "YHBCZ"; // 用户不存在
    public static final String MYJFXM = "MYJFXM"; // 没有缴费项目
    public static final String YJFXM = "YJFXM"; // 有缴费项目

    /**
     * 轮播图
     */
    public static final String TPBCZ = "TPBCZ"; // 有缴费项目


    public static final String MYJFDW = "MYJFDW"; // 没有缴费单位

    /**
     * 缴费支付
     */
    public static final String MYJFYH = "MYJFYH"; // 没有查到缴费用户
    public static final String JFDWBCZ = "JFDWBCZ"; // 缴费单位不存在
    public static final String JFDDBCZ = "JFDDBCZ"; // 缴费订单不存在
    public static final String DDYZF = "DDYZF"; // 该缴费订单已支付
    public static final String JFXMBCZ = "JFXMBCZ"; // 该缴费订单已支付

    /**
     * csp返回状态码
     */
    public static final String CSPSUCCESS = "00"; // 该缴费订单已支付
    public static final String CSPCHONGFU = "33"; // 该缴费订单已支付
    public static final String CSPERROR = "99"; // 该缴费订单已支付


    public static final String YJF = "P-00"; // 已缴费
    public static final String DJF = "04"; // 待缴费


    public static final String YPF = "YPF"; // 已批分
    public static final String YSL = "YSL"; // 已受理
    public static final String YHF = "YHF"; // 已回复
    public static final String YSH = "YSH"; // 已审核

    public static final String BankSuperAdmin = "1"; //String类型 超级管理员
    public static final Integer superadmin = 1; // Integer类型超级管理员
    public static final String SUCCESS = "success";//成功
    public static final String ERROR = "error";//失败
    public static final String MSG = "msg";//
    public static final String DATA = "data";//
    public static final String DESC = "desc";//
    public static final String Danger="danger";
    public static final String YES = "Y";//是
    public static final String NO = "N";//否

    public static final String SELECTALL = "请选择";//选择全部
    public  static final String MERCHANT_CODE_FRONT = "3747";//商户编码前缀

    public static final String LBT = "1";//轮播图
    public static final String GG = "2";//公告

    public static final String TRUE = "1";//是
    public static final String FLASE = "0";//否

    public static final String[] REQUIREMENTTYPE = new String[]{"000", "001", "002"};  //需求类型 000员工心声(需求) 001建议  002有奖征集

    //需求状态 000草稿 001已提交（发布） 002已退回 003已删除 005已结束 status
    public static final String[] REQUIREMENTSTATUS = new String[]{"000", "001", "002", "003", "004", "005"};

    //审批状态 approval   审核通过10  直接删除11 重新指派12 上报分行13 员工退回修改14 持续根据15  重新提交16 经办退回修改17
    public static final String[] APPROVAL = new String[]{"10", "11", "12"};

    public static final String SESSION_SECURITY_CODE = "sessionSecCode";//验证码
    public static final String SESSION_USER = "sessionUser";            //session用的用户

    public static final String LOGIN = "/login_toLogin.do";                //登录地址

    public static final String FILETYPE_FILE = "file";    //文件类型 - 文件
    public static final String FILETYPE_PICTURE = "picture";    //文件类型 - 图片

    public static final String FILEPATHIMG = "uploadFiles/uploadImgs/";    //图片上传路径
    public static final String FILEPATHFILE = "uploadFiles/file/";        //文件上传路径
    public static final String FILETMPFILE = "uploadFiles/tmp/";
    public static final String BANNER = "uploadFiles/banner/"; //banner图片
    public static final String FILEPATHTWODIMENSIONCODE = "uploadFiles/twoDimensionCode/"; //二维码存放路径
    /**
     * APP Constants
     */
    //app注册接口_请求协议参数)
    public static final String[] APP_REGISTERED_PARAM_ARRAY = new String[]{"countries", "uname", "passwd", "title", "full_name", "company_name", "countries_code", "area_code", "telephone", "mobile"};
    public static final String[] APP_REGISTERED_VALUE_ARRAY = new String[]{"国籍", "邮箱帐号", "密码", "称谓", "名称", "公司名称", "国家编号", "区号", "电话", "手机号"};
    //app根据用户名获取会员信息接口_请求协议中的参数
    public static final String[] APP_GETAPPUSER_PARAM_ARRAY = new String[]{"USERNAME"};
    public static final String[] APP_GETAPPUSER_VALUE_ARRAY = new String[]{"用户名"};
    public static String SYSNAME; //系统名称路径
    public static Integer PAGE;   //分页条数配置路径
    public static String EMAIL;   //邮箱服务器配置路径
    public static String SMS1;   //短信账户配置路径1
    public static String SMS2;     //短信账户配置路径2
    public static String FWATERM;    //文字水印配置路径
    public static String IWATERM;   //图片水印配置路径
    public static String WEIXIN;    //微信配置路径
    public static String WEBSOCKET;//WEBSOCKET配置路径
    public static String CurrentPage = "pageindex"; // 当前页

    public static HashMap<String, String> errorInfo = new HashMap();


    public static String COMMITED = "C"; // 工作申请已提交状态
    public static String APPROVED = "P"; // 已同意
    public static String CompanyCode = "CompanyCode";//企业代码
    public static String empCode = "empCode";//员工代码
    public static String IDNO = "idno";//员工身份证号
    public static String MOBLENO = "mobleno";//员工身份证号

    public static String CARD = "card";//卡信息
    public static String BAL = "bal";  //余额信息
    public static String Trade = "trade";  //余额信息


    public static final String USERICON = "uploadFiles/icon";
    public static final String APPPATHFILE = "uploadFiles/appfile/";  //申请文件路径

    public  static final String MpApprove = "10005"; //名片申请

    public static String spercomUsercode = "admin";//意见反馈



    //访问连接路径
    public static class Path {

        public static String LOGIN = "/xinyi/app/admin";//登录
        public static String INDEX = "/xinyi/app/index";//主页(无点击)
        public static String ZHUYEXIANSHI = "/xinyi/app/message/getToTatolMessage";//主页显示消息(无点击)
        public static String TOJOBMANAGER = "/xinyi/app/admin/job/toJobManager";//跳转到工作管理界面
        public static String SalaryBill = "/xinyi/app/admin/salary/toSalaryBill";//薪资查询
        public static String SalaryBillDetail = "/xinyi/app/admin/salary/getSalaryBill";//薪资明细(无点击)
        public static String TXDETAIL = "/xinyi/app/admin/txDetail";//交易明细
        public static String JIAOFEI = "/xinyi/app/jisofei";//缴费充值
        public static String TONGXUNLU = "/xinyi/app/admin/contract/toContract";//通讯录
        public static String TONGXUNLUMINGXI = "/xinyi/app/admin/contract/toEmpDetail";//通讯录明细;
        public static String MyCompany = "/xinyi/app/admin/company/tomyCompany";//我的企业
        public static String findMyCompanys = "/xinyi/app/admin/findMyCompanys";//查询绑定企业(无点击)
        public static String MessagePage = "/xinyi/app/admin/messagge/toMessagePage";//消息
        public static String MyPage = "/xinyi/app/admin/mine/myPage";//我的页面
        public static String MYCard = "/xinyi/app/admin/mime/toMyCards";//我的卡片
        public static String CardManager = "/xinyi/app/admin/mine/managerCard";//卡片管理
        public static String DefaultCard = "/xinyi/app/admin/mime/setDefaultCard";//设置默认卡(有点击，没加连接)
        public static String XIUGAIMIMA = "/xinyi//app/admin/mine/updPwd";//修改密码
        public static String WODEMINGPIAN = "/xinyi/app/operator/user/getUserById";//我的名片
        public static String YiShang = "/xinyi/app/yishang";//易商理财
        public static String YiDai = "/xinyi/app/yidai";//中银E贷
        public static String SHEZHI = "/xinyi/app/admin/setting";//设置
        public static String FEEDBACK = "/xinyi/app/admin/tofeedback";//意见反馈
        public static String LOGOUT = "/xinyi/app/logout";//退出



        public static String V = "V";//查询系统消息
        public static String L = "L";//登录
        public static String B = "B";//查询工资单
        public static String T = "T";//通讯录
        public static String TM = "TM";//通讯录明细
        public static String W = "W";//工作管理
        public static String M = "M";//我的页面
        public static String Y = "Y";//易商理财
        public static String E = "E";//中银E贷
        public static String J = "J";//交易明细
        public static String C = "C";//我的企业
        public static String G = "G";//缴费充值
        public static String MC = "MC";//我的卡片
        public static String MM = "MM";//卡片管理
        public static String P = "P";//修改密码
        public static String WM = "WM";//我的名片
        public static String SZ = "SZ";//设置
        public static String FB = "FB";//意见反馈
        public static String TC = "TC";//退出
        public static String IX = "IX";//主页
        public static String TZ = "TZ";//跳转查询

    }


    /**
     * COM_CONTENT 表状态
     */


    public static class SysLogType {
        public static final String VIEWMESSGE = "V";//查看消息
        public static final String LOGIN = "L";//登录

    }


    /**
     * COM_CONTENT 表状态
     */
    public static class ComContentStatus {
        public static final String OK = "Y";//同意
        public static final String REJECT = "R";//拒绝
        public static final String REASSIGN = "S";//重新指定
        public static final String BOHUI = "B";//驳回
        public static final String COMMIT = "C";//经办后
    }


    /**
     * cms_approve 表状态
     */
    public static class ApproveStatus {
        public static final String AFETER_PF = "2";//批分后
        public static final String AFETER_JB = "3";//经办后
        public static final String AFETER_SP = "4";//审批后
        public static final String REJECT_SP = "7";//总经理审批拒绝

    }


    /**
     * cms_content 表状态
     */
    public static class MasterStatus {
        public static final Integer NEW = 1;//需求提出
        public static final Integer PF_REJECT = -1;//批分人员拒绝新需求
        public static final Integer JB_REJECT = 6;// 经办人员拒绝
        public static final Integer PF = 2;  //批分后
        public static final Integer ALL_SP_DONE = 5;  //所有的办公室流程走完,主状态为5
        public static final Integer JB_SUBMIT2SH = 9;  //经办提交到省行
        public static final Integer REVOKE = -4;  //撤销需求

    }


    /**
     * 审批步骤
     */

    public static class Steps {
        public static final String PF = "PF";//批分
        public static final String JB = "JB";//部门经办
        public static final String SP = "SP";//办公室审批
    }


    public static class SolveType {
        public static final String SUBMIT2SH = "P";//提交至省行
        public static final String CONTINUE = "C";//持续更近
        public static final String SOLVED = "S";  //已解决
    }

    /**
     *
     * 类名：RemindCode  <br />
     *
     * 功能：
     *
     * @author xtwin <br />
     * 创建时间：2015-8-3 下午03:10:54  <br />
     * @version 2015-8-3
     */
    public static final class RemindCode {

        // 提醒
        public static final String REMIND = "01";

        // 不再提醒
        public static final String NOT_REMIND = "02";
    }

    /**
     *
     * 类名：LogSummary  <br />
     *
     * 功能：日志代码
     *
     * @author xtwin <br />
     * 创建时间：2015-7-31 上午11:02:45  <br />
     * @version 2015-7-31
     */
    public static final class LogSummary {

        // 日志摘要
        public static final String SETTLE = "settle";
    }

    /**
     *
     * 类名：SystemLogType  <br />
     *
     * 功能：系统日志类型
     *
     * @author xtwin <br />
     * 创建时间：2015-7-31 上午10:03:21  <br />
     * @version 2015-7-31
     */
    public static final class SystemLogType {

        // 系统日志
        public static final String LOG_SYSTEM = "01";

        // 业务日志，查询
        public static final String LOG_SERVICE_QUERY = "02";

        // 业务日志，创建
        public static final String LOG_SERVICE_CREATE = "03";

        // 业务日志，更新
        public static final String LOG_SERVICE_UPDATE = "04";

        // 业务日志，移除
        public static final String LOG_SERVICE_REMOVE = "05";

        // 业务日志，对账
        public static final String LOG_SERVICE_SETTLE = "06";
    }

    /**
     * app版本类型
     * @author lijunjin
     *
     */
    public static final class versionsType{
        //当前版本
        public static final String VERSIONS_TYPE_CURRENT = "01";
        //02：历史版本
        public static final String VERSIONS_TYPE_HISTORY = "02";
    }

    /**
     * app版本是否强制更新
     * @author lijunjin
     *
     */
    public static final class enforce{
        //01：强制
        public static final String ENFORCE_YES = "01";
        //02：非强制
        public static final String ENFORCE_NO = "02";
    }
    /**
     *
     * 类名：Status  <br />
     *
     * 功能：
     *
     * @author xtwin <br />
     * 创建时间：2015-7-8 下午05:20:21  <br />
     * @version 2015-7-8
     */
    public static final class Status {

        // 未审核
        public static final String STATUS_UNAUDIT = "01";

        // 正常
        public static final String STATUS_NORMAL = "02";

        // 禁用
        public static final String STATUS_DISABLED = "03";
    }

    /**
     *
     * 类名：OperatorType  <br />
     *
     * 功能：操作员类型
     *
     * @author xtwin <br />
     * 创建时间：2015-6-26 下午03:08:18  <br />
     * @version 2015-6-26
     */
    public static final class OperatorType {

        // 超级管理员
        public static final String SUPPERADMIN = "01";

        // 管理员
        public static final String ADMIN = "02";

        // 柜员
        public static final String OPERATOR = "03";
    }
    /**
     *
     * 类名：NotifyTarget  <br />
     *
     * 功能：操作员类型
     *
     * @author wlj <br />
     * 创建时间：2017-12-18 下午03:08:18  <br />
     * @version 2017-12-18
     */
    public static final class NotifyTarget {

        // 01：银行端管理人员 02：银行端柜员 03：缴费单位管理人员 04：缴费单位缴费用户';
        public static final String ONE = "01";

        public static final String TWO = "02";

        public static final String THREE = "03";

        public static final String FOUR = "04";

        public static final String ZERO = "00";
    }
    /**
     *
     * 类名：FeeUserProjectPayment  <br />
     *
     * 功能：订单状态
     *
     * @author xtwin <br />
     * 创建时间：2015-7-3 下午05:16:33  <br />
     * @version 2015-7-3
     */
    public static final class FeeUserProjectPaymentStatus {
        // 未支付
        public static final String STATUS_PAY_UN_PAY = "04";
    }

    /**
     *
     * 类名：SystemCode  <br />
     *
     * 功能：系统代码
     *
     * @author xtwin <br />
     * 创建时间：2015-7-6 下午04:03:31  <br />
     * @version 2015-7-6
     */
    public static final class SystemCode {

        // 银行端管理系统
        public static final String CODE_BMS = "01";

        // 收费单位端管理系统
        public static final String CODE_MMS = "02";

        // 业务系统
        public static final String CODE_BPS = "03";
    }


    static {
        HashMap<String, String> tmp = errorInfo;
        tmp.put("SUCCESS", "SUCCESS");
        tmp.put("NOFILE", "未包含文件上传域");
        tmp.put("TYPE", "不允许的文件格式");
        tmp.put("SIZE", "文件大小超出限制");
        tmp.put("ENTYPE", "请求类型ENTYPE错误");
        tmp.put("REQUEST", "上传请求异常");
        tmp.put("IO", "IO异常");
        tmp.put("DIR", "目录创建失败");
        tmp.put("UNKNOWN", "未知错误");


        InputStream in = new BufferedInputStream(Const.class.getClassLoader().getResourceAsStream("System.properties"));
        Properties prop = new Properties();
        try {
            prop.load(in);
            SYSNAME = prop.getProperty("SystemName");
            PAGE = Integer.parseInt(prop.getProperty("PageSize"));
            EMAIL = prop.getProperty("Email");
            SMS1 = prop.getProperty("SMS1");
            SMS2 = prop.getProperty("SMS2");
            WEBSOCKET = prop.getProperty("WEBSOCKET");
            WEIXIN = prop.getProperty("WEIXIN");
            FWATERM = prop.getProperty("FWATERM");
            IWATERM = prop.getProperty("IWATERM");
        } catch (IOException e) {
            e.printStackTrace();
        }

    }







}
